home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 11707 < prev    next >
Encoding:
Text File  |  1996-08-05  |  936 b   |  58 lines

  1. Path: badger.wmin.ac.uk!darec
  2. From: darec@westminster.ac.uk (Nadarajah Thavaneethan)
  3. Newsgroups: comp.lang.c
  4. Subject: Please help me
  5. Date: 25 Mar 1996 18:28:30 GMT
  6. Organization: University of Westminster
  7. Message-ID: <4j6oke$lfk@badger.wmin.ac.uk>
  8. NNTP-Posting-Host: badger.wmin.ac.uk
  9. X-Newsreader: TIN [version 1.2 PL2]
  10.  
  11. #include <std.h>
  12.  
  13. void writelines( char[], int );
  14.         int index;
  15.  
  16.  
  17. void main(void)
  18. {
  19.  
  20. int i;
  21. char rest[80];
  22.  
  23.  
  24.     printf("Enter line ");
  25.     scanf("%s", rest);
  26.     printf("Enter size of new lines");
  27.     scanf("%d", i);
  28.     index =0;
  29.     writelines(rest, i);
  30. }
  31.  
  32. void writelines( char r[], int len)
  33. {
  34. int i;
  35.  
  36.        while (index < 80) {
  37.      for  (i=0; i<len; i++)
  38.      {
  39.  
  40.        putchar(r[index]);
  41.        putchar('\n');
  42.        }
  43.         index++;
  44. }
  45. }
  46.  
  47. This program reads a line of data and writes it out as smaller lines
  48. it doesn't but it should!
  49.  
  50. please mail me 
  51.  
  52. darec@westminster.ac.uk
  53.  
  54.  
  55. Thanks in Advance..
  56.  
  57.  
  58.